package ModelLayer;
import java.util.ArrayList;


/**
 * Write a description of class Udlaan here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Udlaan
{
    // instance variables
    public static int id;
    private String dato;
    private String periode;
    public boolean udlaant;
    private ArrayList<DVD> dvds;
    
    /**
     * Constructor for objects of class Udlaan
     */
    public Udlaan(int id, String dato, String periode)
    {
        this.id = id;
        this.dato = dato;
        this.periode = periode;
        udlaant = false;
        dvds = new ArrayList<DVD>();
    }
    
    // set methods (Mutators)
    
    public void deliverDVD(DVD dvd)
    {
        dvds.remove(dvd);
    }
    
    public void addDVD(DVD dvd) 
    {
        if(dvd.getEksemplar() != 0) {
            dvds.add(dvd);
        } else {
            System.out.println("There isn't any copies of this DVD.");
        }
    }
    
    public void setDato(String dato) 
    {
        this.dato = dato;
    }
    
    public void setPeriode(String periode) 
    {
        this.periode = periode;
    }
    
    public void setUdlaant(boolean udlaant)
    {
        this.udlaant = udlaant;
    }

    // get methods (Accesors)
    
    public void getDVDTitles() 
    {
        System.out.println("# DVD titles : ");
        int i = 1;
        for(DVD dvd : dvds) 
        {
                System.out.println(i + ": " + dvd.titel);
                i++;
        }
    }
    
    public String getDato()
    {
        return dato;
    }
    
    public String getPeriode()
    {
        return periode;
    }
    
    public boolean getUdlaant()
    {
        return udlaant;
    }
}
